/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import DAO.Iter.TraLoiDAO;
import TableModel.Dapan;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
 *
 * @author vt
 */
public class TraLoiDAOImpl extends HibernateDaoSupport implements TraLoiDAO {

    @Override
    public List<Dapan> findAllTraloi() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Dapan findTraLoi(String idCauhoi) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Dapan findTraLoi(String userName, String paawrod) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void update(Dapan id) {
       this.getHibernateTemplate().update(id);
    }
    @Override
    public long add(Dapan id) {
        long a =  (Long) this.getHibernateTemplate().save(id);
        return a;
    }

    @Override
    public void delete(Dapan id) {
        this.getHibernateTemplate().delete(id);
    }

    @Override
    public List<Dapan> getListTraLoi(String idMaDe) {
       return this.getHibernateTemplate().find("from Traloi traloi where traloi.made=?",idMaDe);
    }

    
    
}
